package com.mentor.mate.academy.gamebook;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

public class FirstQuest extends Activity implements OnClickListener {

	private TextView ppTextView, hpTextView;
	private int hp, pp;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.first_quest);
		readDataFromBundle();

		initLayout();
	}

	private void initLayout() {
		ppTextView = (TextView) findViewById(R.id.pp);
		hpTextView = (TextView) findViewById(R.id.hp);
		setValues();

	}

	private void setValues() {
		ppTextView.setText("PP: " + pp);
		hpTextView.setText("HP: " + hp);
	}

	@Override
	public void onClick(View v) {
	}

	private void readDataFromBundle() {
		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();
		if (bundle.containsKey("hp")) {
			hp = bundle.getInt("hp");
		}
		if (bundle.containsKey("pp")) {
			pp = bundle.getInt("pp");
		}
	}

}
